﻿#ifndef IMAGEVIEWER_H
#define IMAGEVIEWER_H

#include <QDialog>

namespace Ui {
class ImageViewer;
}

class ImageViewer : public QDialog
{
    Q_OBJECT

public:
    explicit ImageViewer(QWidget *parent = Q_NULLPTR);
    ~ImageViewer();

    void setImage(const QImage &image);
    void setPixmap(const QPixmap &pixmap);
private slots:

    void on_button_zoomin_clicked();

    void on_button_zoomout_clicked();

    void on_button_normal_clicked();

    void on_button_copy_clicked();

    void on_button_saveas_clicked();

private:
    void setProperSize(const QSize &imageSize);
    void scaleImage(double factor);
    bool saveFile(const QString &fileName);
    Ui::ImageViewer *ui;
    double scaleFactor;
};

#endif // IMAGEVIEWER_H
